3.451 \(\int (c \cos (e+f x))^m (a+b \cos (e+f x))^3 (A+B \cos (e+f x)) \, dx\)

Optimal. Leaf size=406 \[ -\frac {\sin (e+f x) \left (b (m+1) \left (2 a^2 B (m+5)+3 a A b (m+4)+b^2 B (m+3)\right )+a^2 (m+2) (a A (m+4)+b B (m+1))\right ) (c \cos (e+f x))^{m+1} \, _2F_1\left (\frac {1}{2},\frac {m+1}{2};\frac {m+3}{2};\cos ^2(e+f x)\right )}{c f (m+1) (m+2) (m+4) \sqrt {\sin ^2(e+f x)}}+\frac {b \sin (e+f x) \left (2 a^2 B (m+5)+3 a A b (m+4)+b^2 B (m+3)\right ) (c \cos (e+f x))^{m+1}}{c f (m+2) (m+4)}-\frac {\sin (e+f x) \left (a^3 B (m+3)+3 a^2 A b (m+3)+3 a b^2 B (m+2)+A b^3 (m+2)\right ) (c \cos (e+f x))^{m+2} \, _2F_1\left (\frac {1}{2},\frac {m+2}{2};\frac {m+4}{2};\cos ^2(e+f x)\right )}{c^2 f (m+2) (m+3) \sqrt {\sin ^2(e+f x)}}+\frac {b^2 \sin (e+f x) \cos (e+f x) (a B (m+6)+A b (m+4)) (c \cos (e+f x))^{m+1}}{c f (m+3) (m+4)}+\frac {b B \sin (e+f x) (a+b \cos (e+f x))^2 (c \cos (e+f x))^{m+1}}{c f (m+4)} \]

[Out]

b*(b^2*B*(3+m)+3*a*A*b*(4+m)+2*a^2*B*(5+m))*(c*cos(f*x+e))^(1+m)*sin(f*x+e)/c/f/(2+m)/(4+m)+b^2*(A*b*(4+m)+a*B
*(6+m))*cos(f*x+e)*(c*cos(f*x+e))^(1+m)*sin(f*x+e)/c/f/(3+m)/(4+m)+b*B*(c*cos(f*x+e))^(1+m)*(a+b*cos(f*x+e))^2
*sin(f*x+e)/c/f/(4+m)-(a^2*(2+m)*(b*B*(1+m)+a*A*(4+m))+b*(1+m)*(b^2*B*(3+m)+3*a*A*b*(4+m)+2*a^2*B*(5+m)))*(c*c
os(f*x+e))^(1+m)*hypergeom([1/2, 1/2+1/2*m],[3/2+1/2*m],cos(f*x+e)^2)*sin(f*x+e)/c/f/(1+m)/(2+m)/(4+m)/(sin(f*
x+e)^2)^(1/2)-(A*b^3*(2+m)+3*a*b^2*B*(2+m)+3*a^2*A*b*(3+m)+a^3*B*(3+m))*(c*cos(f*x+e))^(2+m)*hypergeom([1/2, 1
+1/2*m],[2+1/2*m],cos(f*x+e)^2)*sin(f*x+e)/c^2/f/(2+m)/(3+m)/(sin(f*x+e)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 1.05, antiderivative size = 406, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.152, Rules used = {2990, 3033, 3023, 2748, 2643} \[ -\frac {\sin (e+f x) \left (3 a^2 A b (m+3)+a^3 B (m+3)+3 a b^2 B (m+2)+A b^3 (m+2)\right ) (c \cos (e+f x))^{m+2} \, _2F_1\left (\frac {1}{2},\frac {m+2}{2};\frac {m+4}{2};\cos ^2(e+f x)\right )}{c^2 f (m+2) (m+3) \sqrt {\sin ^2(e+f x)}}-\frac {\sin (e+f x) \left (b (m+1) \left (2 a^2 B (m+5)+3 a A b (m+4)+b^2 B (m+3)\right )+a^2 (m+2) (a A (m+4)+b B (m+1))\right ) (c \cos (e+f x))^{m+1} \, _2F_1\left (\frac {1}{2},\frac {m+1}{2};\frac {m+3}{2};\cos ^2(e+f x)\right )}{c f (m+1) (m+2) (m+4) \sqrt {\sin ^2(e+f x)}}+\frac {b \sin (e+f x) \left (2 a^2 B (m+5)+3 a A b (m+4)+b^2 B (m+3)\right ) (c \cos (e+f x))^{m+1}}{c f (m+2) (m+4)}+\frac {b^2 \sin (e+f x) \cos (e+f x) (a B (m+6)+A b (m+4)) (c \cos (e+f x))^{m+1}}{c f (m+3) (m+4)}+\frac {b B \sin (e+f x) (a+b \cos (e+f x))^2 (c \cos (e+f x))^{m+1}}{c f (m+4)} \]

Antiderivative was successfully verified.

[In]

Int[(c*Cos[e + f*x])^m*(a + b*Cos[e + f*x])^3*(A + B*Cos[e + f*x]),x]

[Out]

(b*(b^2*B*(3 + m) + 3*a*A*b*(4 + m) + 2*a^2*B*(5 + m))*(c*Cos[e + f*x])^(1 + m)*Sin[e + f*x])/(c*f*(2 + m)*(4
+ m)) + (b^2*(A*b*(4 + m) + a*B*(6 + m))*Cos[e + f*x]*(c*Cos[e + f*x])^(1 + m)*Sin[e + f*x])/(c*f*(3 + m)*(4 +
 m)) + (b*B*(c*Cos[e + f*x])^(1 + m)*(a + b*Cos[e + f*x])^2*Sin[e + f*x])/(c*f*(4 + m)) - ((a^2*(2 + m)*(b*B*(
1 + m) + a*A*(4 + m)) + b*(1 + m)*(b^2*B*(3 + m) + 3*a*A*b*(4 + m) + 2*a^2*B*(5 + m)))*(c*Cos[e + f*x])^(1 + m
)*Hypergeometric2F1[1/2, (1 + m)/2, (3 + m)/2, Cos[e + f*x]^2]*Sin[e + f*x])/(c*f*(1 + m)*(2 + m)*(4 + m)*Sqrt
[Sin[e + f*x]^2]) - ((A*b^3*(2 + m) + 3*a*b^2*B*(2 + m) + 3*a^2*A*b*(3 + m) + a^3*B*(3 + m))*(c*Cos[e + f*x])^
(2 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e + f*x]^2]*Sin[e + f*x])/(c^2*f*(2 + m)*(3 + m)*Sqrt
[Sin[e + f*x]^2])

Rule 2643

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(Cos[c + d*x]*(b*Sin[c + d*x])^(n + 1)*Hypergeomet
ric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2])/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]), x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 2748

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 2990

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e
_.) + (f_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*B*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 1)*(c + d*Sin[e + f*x]
)^(n + 1))/(d*f*(m + n + 1)), x] + Dist[1/(d*(m + n + 1)), Int[(a + b*Sin[e + f*x])^(m - 2)*(c + d*Sin[e + f*x
])^n*Simp[a^2*A*d*(m + n + 1) + b*B*(b*c*(m - 1) + a*d*(n + 1)) + (a*d*(2*A*b + a*B)*(m + n + 1) - b*B*(a*c -
b*d*(m + n)))*Sin[e + f*x] + b*(A*b*d*(m + n + 1) - B*(b*c*m - a*d*(2*m + n)))*Sin[e + f*x]^2, x], x], x] /; F
reeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m,
1] &&  !(IGtQ[n, 1] && ( !IntegerQ[m] || (EqQ[a, 0] && NeQ[c, 0])))

Rule 3023

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*
(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x]
, x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 3033

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (B_.)*sin[(e
_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*d*Cos[e + f*x]*Sin[e + f*x]*(a + b
*Sin[e + f*x])^(m + 1))/(b*f*(m + 3)), x] + Dist[1/(b*(m + 3)), Int[(a + b*Sin[e + f*x])^m*Simp[a*C*d + A*b*c*
(m + 3) + b*(B*c*(m + 3) + d*(C*(m + 2) + A*(m + 3)))*Sin[e + f*x] - (2*a*C*d - b*(c*C + B*d)*(m + 3))*Sin[e +
 f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] &&
!LtQ[m, -1]

Rubi steps

\begin {align*} \int (c \cos (e+f x))^m (a+b \cos (e+f x))^3 (A+B \cos (e+f x)) \, dx &=\frac {b B (c \cos (e+f x))^{1+m} (a+b \cos (e+f x))^2 \sin (e+f x)}{c f (4+m)}+\frac {\int (c \cos (e+f x))^m (a+b \cos (e+f x)) \left (a c (b B (1+m)+a A (4+m))+c \left (b^2 B (3+m)+a (2 A b+a B) (4+m)\right ) \cos (e+f x)+b c (A b (4+m)+a B (6+m)) \cos ^2(e+f x)\right ) \, dx}{c (4+m)}\\ &=\frac {b^2 (A b (4+m)+a B (6+m)) \cos (e+f x) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (3+m) (4+m)}+\frac {b B (c \cos (e+f x))^{1+m} (a+b \cos (e+f x))^2 \sin (e+f x)}{c f (4+m)}+\frac {\int (c \cos (e+f x))^m \left (a^2 c^2 (3+m) (b B (1+m)+a A (4+m))+c^2 (4+m) \left (A b^3 (2+m)+3 a b^2 B (2+m)+3 a^2 A b (3+m)+a^3 B (3+m)\right ) \cos (e+f x)+b c^2 (3+m) \left (b^2 B (3+m)+3 a A b (4+m)+2 a^2 B (5+m)\right ) \cos ^2(e+f x)\right ) \, dx}{c^2 (3+m) (4+m)}\\ &=\frac {b \left (b^2 B (3+m)+3 a A b (4+m)+2 a^2 B (5+m)\right ) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (2+m) (4+m)}+\frac {b^2 (A b (4+m)+a B (6+m)) \cos (e+f x) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (3+m) (4+m)}+\frac {b B (c \cos (e+f x))^{1+m} (a+b \cos (e+f x))^2 \sin (e+f x)}{c f (4+m)}+\frac {\int (c \cos (e+f x))^m \left (c^3 (3+m) \left (a^2 (2+m) (b B (1+m)+a A (4+m))+b (1+m) \left (b^2 B (3+m)+3 a A b (4+m)+2 a^2 B (5+m)\right )\right )+c^3 (2+m) (4+m) \left (A b^3 (2+m)+3 a b^2 B (2+m)+3 a^2 A b (3+m)+a^3 B (3+m)\right ) \cos (e+f x)\right ) \, dx}{c^3 (2+m) (3+m) (4+m)}\\ &=\frac {b \left (b^2 B (3+m)+3 a A b (4+m)+2 a^2 B (5+m)\right ) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (2+m) (4+m)}+\frac {b^2 (A b (4+m)+a B (6+m)) \cos (e+f x) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (3+m) (4+m)}+\frac {b B (c \cos (e+f x))^{1+m} (a+b \cos (e+f x))^2 \sin (e+f x)}{c f (4+m)}+\frac {\left (A b^3 (2+m)+3 a b^2 B (2+m)+3 a^2 A b (3+m)+a^3 B (3+m)\right ) \int (c \cos (e+f x))^{1+m} \, dx}{c (3+m)}+\frac {\left (a^2 (2+m) (b B (1+m)+a A (4+m))+b (1+m) \left (b^2 B (3+m)+3 a A b (4+m)+2 a^2 B (5+m)\right )\right ) \int (c \cos (e+f x))^m \, dx}{(2+m) (4+m)}\\ &=\frac {b \left (b^2 B (3+m)+3 a A b (4+m)+2 a^2 B (5+m)\right ) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (2+m) (4+m)}+\frac {b^2 (A b (4+m)+a B (6+m)) \cos (e+f x) (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (3+m) (4+m)}+\frac {b B (c \cos (e+f x))^{1+m} (a+b \cos (e+f x))^2 \sin (e+f x)}{c f (4+m)}-\frac {\left (a^2 (2+m) (b B (1+m)+a A (4+m))+b (1+m) \left (b^2 B (3+m)+3 a A b (4+m)+2 a^2 B (5+m)\right )\right ) (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{c f (1+m) (2+m) (4+m) \sqrt {\sin ^2(e+f x)}}-\frac {\left (A b^3 (2+m)+3 a b^2 B (2+m)+3 a^2 A b (3+m)+a^3 B (3+m)\right ) (c \cos (e+f x))^{2+m} \, _2F_1\left (\frac {1}{2},\frac {2+m}{2};\frac {4+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{c^2 f (2+m) (3+m) \sqrt {\sin ^2(e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 2.81, size = 269, normalized size = 0.66 \[ \frac {\sin (e+f x) \cos (e+f x) (c \cos (e+f x))^m \left (\cos (e+f x) \left (b \cos (e+f x) \left (b \cos (e+f x) \left (-\frac {(3 a B+A b) \, _2F_1\left (\frac {1}{2},\frac {m+4}{2};\frac {m+6}{2};\cos ^2(e+f x)\right )}{m+4}-\frac {b B \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {m+5}{2};\frac {m+7}{2};\cos ^2(e+f x)\right )}{m+5}\right )-\frac {3 a (a B+A b) \, _2F_1\left (\frac {1}{2},\frac {m+3}{2};\frac {m+5}{2};\cos ^2(e+f x)\right )}{m+3}\right )-\frac {a^2 (a B+3 A b) \, _2F_1\left (\frac {1}{2},\frac {m+2}{2};\frac {m+4}{2};\cos ^2(e+f x)\right )}{m+2}\right )-\frac {a^3 A \, _2F_1\left (\frac {1}{2},\frac {m+1}{2};\frac {m+3}{2};\cos ^2(e+f x)\right )}{m+1}\right )}{f \sqrt {\sin ^2(e+f x)}} \]

Antiderivative was successfully verified.

[In]

Integrate[(c*Cos[e + f*x])^m*(a + b*Cos[e + f*x])^3*(A + B*Cos[e + f*x]),x]

[Out]

(Cos[e + f*x]*(c*Cos[e + f*x])^m*(-((a^3*A*Hypergeometric2F1[1/2, (1 + m)/2, (3 + m)/2, Cos[e + f*x]^2])/(1 +
m)) + Cos[e + f*x]*(-((a^2*(3*A*b + a*B)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e + f*x]^2])/(2 + m)
) + b*Cos[e + f*x]*((-3*a*(A*b + a*B)*Hypergeometric2F1[1/2, (3 + m)/2, (5 + m)/2, Cos[e + f*x]^2])/(3 + m) +
b*Cos[e + f*x]*(-(((A*b + 3*a*B)*Hypergeometric2F1[1/2, (4 + m)/2, (6 + m)/2, Cos[e + f*x]^2])/(4 + m)) - (b*B
*Cos[e + f*x]*Hypergeometric2F1[1/2, (5 + m)/2, (7 + m)/2, Cos[e + f*x]^2])/(5 + m)))))*Sin[e + f*x])/(f*Sqrt[
Sin[e + f*x]^2])

________________________________________________________________________________________

fricas [F]  time = 0.98, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (B b^{3} \cos \left (f x + e\right )^{4} + A a^{3} + {\left (3 \, B a b^{2} + A b^{3}\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (B a^{2} b + A a b^{2}\right )} \cos \left (f x + e\right )^{2} + {\left (B a^{3} + 3 \, A a^{2} b\right )} \cos \left (f x + e\right )\right )} \left (c \cos \left (f x + e\right )\right )^{m}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))^m*(a+b*cos(f*x+e))^3*(A+B*cos(f*x+e)),x, algorithm="fricas")

[Out]

integral((B*b^3*cos(f*x + e)^4 + A*a^3 + (3*B*a*b^2 + A*b^3)*cos(f*x + e)^3 + 3*(B*a^2*b + A*a*b^2)*cos(f*x +
e)^2 + (B*a^3 + 3*A*a^2*b)*cos(f*x + e))*(c*cos(f*x + e))^m, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \cos \left (f x + e\right ) + A\right )} {\left (b \cos \left (f x + e\right ) + a\right )}^{3} \left (c \cos \left (f x + e\right )\right )^{m}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))^m*(a+b*cos(f*x+e))^3*(A+B*cos(f*x+e)),x, algorithm="giac")

[Out]

integrate((B*cos(f*x + e) + A)*(b*cos(f*x + e) + a)^3*(c*cos(f*x + e))^m, x)

________________________________________________________________________________________

maple [F]  time = 3.00, size = 0, normalized size = 0.00 \[ \int \left (c \cos \left (f x +e \right )\right )^{m} \left (a +b \cos \left (f x +e \right )\right )^{3} \left (A +B \cos \left (f x +e \right )\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*cos(f*x+e))^m*(a+b*cos(f*x+e))^3*(A+B*cos(f*x+e)),x)

[Out]

int((c*cos(f*x+e))^m*(a+b*cos(f*x+e))^3*(A+B*cos(f*x+e)),x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \cos \left (f x + e\right ) + A\right )} {\left (b \cos \left (f x + e\right ) + a\right )}^{3} \left (c \cos \left (f x + e\right )\right )^{m}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))^m*(a+b*cos(f*x+e))^3*(A+B*cos(f*x+e)),x, algorithm="maxima")

[Out]

integrate((B*cos(f*x + e) + A)*(b*cos(f*x + e) + a)^3*(c*cos(f*x + e))^m, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int {\left (c\,\cos \left (e+f\,x\right )\right )}^m\,\left (A+B\,\cos \left (e+f\,x\right )\right )\,{\left (a+b\,\cos \left (e+f\,x\right )\right )}^3 \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*cos(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^3,x)

[Out]

int((c*cos(e + f*x))^m*(A + B*cos(e + f*x))*(a + b*cos(e + f*x))^3, x)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))**m*(a+b*cos(f*x+e))**3*(A+B*cos(f*x+e)),x)

[Out]

Timed out

________________________________________________________________________________________